import {useProgressStore} from '@/stores/progress'
import pinia from '@/stores'

let progressStore = useProgressStore(pinia)

let req = (callback: Function) => {
  progressStore.progressStart()
  return new Promise<any>((resolve, reject) => {
    setTimeout(() => {
      progressStore.progressEnd()
      resolve(callback())
    }, 300)
  })
}

export default req